class CreateUserItems < ActiveRecord::Migration
  def self.up
    create_table(:user_items, {:force => true, :options =>'ENGINE=InnoDB DEFAULT CHARSET=utf8'}) do |t|
      t.column :user_id,               :integer, :null => false
      t.column :course_id,                :integer, :null => false
      t.column :item_id,                  :integer, :null => false
      t.column :error_rate,               :integer, :null => 0
      t.column :progress,                 :integer, :default => 0
      t.timestamps
    end
  end

  def self.down
    drop_table :user_items
  end
end
